//
//  HMNavgationController.swift
//  swift微博项目
//
//  Created by huodian on 16/9/22.
//  Copyright © 2016年 huodian. All rights reserved.
//

import UIKit

class HMNavgationController: UINavigationController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        // Do any additional setup after loading the view.
    }
    override func pushViewController(_ viewController: UIViewController, animated: Bool) {
        
        let count  = self.childViewControllers.count
        
        
        if count > 0 {
      
            viewController.navigationItem.leftBarButtonItem = UIBarButtonItem(title: "返回", imageNamed: "navigationbar_back_withtext", target: self, action: #selector(back))
            
            
            viewController.hidesBottomBarWhenPushed = true
            
        }
            
            super.pushViewController(viewController, animated: animated)

        
        
        
        
        
        
    }
    
            func back(){
            
            self.popViewController(animated: true)
            
            
            }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

   
    

}
